//
//  RankListCell.m
//  PlayCatchGame
//
//  Created by 流言 on 2018/1/29.
//  Copyright © 2018年 清正. All rights reserved.
//

#import "RankListCell.h"
#import "AppHeader.h"

@implementation RankListCell

- (void)awakeFromNib {
    [super awakeFromNib];

}

+ (instancetype)findCellWithIdentifier:(NSString*)identifier {
    NSArray *cellArray =[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil];
    for (RankListCell *cell in cellArray) {
        if ([cell.reuseIdentifier isEqualToString:identifier]) {
            return cell;
        }
    }
    return nil;
}

- (void)setIndex:(NSInteger)index {
    _index =index;
    if (index ==0) {
        [self.indexButton setImage:[UIImage imageNamed:@"paihangbang_1"] forState:UIControlStateNormal];
        [self.indexButton setTitle:@"" forState:UIControlStateNormal];
    } else if (index ==1) {
        [self.indexButton setImage:[UIImage imageNamed:@"paihangbang_2"] forState:UIControlStateNormal];
        [self.indexButton setTitle:@"" forState:UIControlStateNormal];
    } else if (index ==2) {
        [self.indexButton setImage:[UIImage imageNamed:@"paihangbang_3"] forState:UIControlStateNormal];
        [self.indexButton setTitle:@"" forState:UIControlStateNormal];
    } else {
        [self.indexButton setImage:[UIImage imageNamed:@"clear_image"] forState:UIControlStateNormal];
        [self.indexButton setTitle:[NSString stringWithFormat:@"%ld", index] forState:UIControlStateNormal];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
